package com.dianping.cat.consumer.storage.model.entity;

import com.dianping.cat.consumer.storage.model.BaseEntity;
import com.dianping.cat.consumer.storage.model.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;




public class Domain
  extends BaseEntity<Domain>
{
  private String m_id;
/*  15 */   private Map<String, Operation> m_operations = new LinkedHashMap();

/*  17 */   private Map<String, Sql> m_sqls = new LinkedHashMap();





/*  23 */   public Domain(String id) { this.m_id = id; }




/*  28 */   public void accept(IVisitor visitor) { visitor.visitDomain(this); }


  public Domain addOperation(Operation operation) {
    this.m_operations.put(operation.getId(), operation);
/*  33 */     return this;
  }

  public Domain addSql(Sql sql) {
/*  37 */     this.m_sqls.put(sql.getId(), sql);
/*  38 */     return this;
  }


  public boolean equals(Object obj) {
/*  43 */     if (obj instanceof Domain) {
/*  44 */       Domain _o = (Domain)obj;

/*  46 */       if (!equals(getId(), _o.getId())) {
/*  47 */         return false;
      }

/*  50 */       return true;
    }

/*  53 */     return false;
  }


/*  57 */   public Operation findOperation(String id) { return (Operation)this.m_operations.get(id); }



/*  61 */   public Sql findSql(String id) { return (Sql)this.m_sqls.get(id); }


  public Operation findOrCreateOperation(String id) {
/*  65 */     Operation operation = (Operation)this.m_operations.get(id);

/*  67 */     if (operation == null) {
/*  68 */       synchronized (this.m_operations) {
/*  69 */         operation = (Operation)this.m_operations.get(id);

/*  71 */         if (operation == null) {
/*  72 */           operation = new Operation(id);
/*  73 */           this.m_operations.put(id, operation);
        }
      }
    }

    return operation;
  }

  public Sql findOrCreateSql(String id) {
/*  82 */     Sql sql = (Sql)this.m_sqls.get(id);

/*  84 */     if (sql == null) {
/*  85 */       synchronized (this.m_sqls) {
/*  86 */         sql = (Sql)this.m_sqls.get(id);

/*  88 */         if (sql == null) {
/*  89 */           sql = new Sql(id);
/*  90 */           this.m_sqls.put(id, sql);
        }
      }
    }

/*  95 */     return sql;
  }


/*  99 */   public String getId() { return this.m_id; }



/* 103 */   public Map<String, Operation> getOperations() { return this.m_operations; }



/* 107 */   public Map<String, Sql> getSqls() { return this.m_sqls; }






/* 121 */   public void mergeAttributes(Domain other) { assertAttributeEquals(other, "domain", "id", this.m_id, other.getId()); }




/* 126 */   public Operation removeOperation(String id) { return (Operation)this.m_operations.remove(id); }



/* 130 */   public Sql removeSql(String id) { return (Sql)this.m_sqls.remove(id); }


  public Domain setId(String id) {
/* 134 */     this.m_id = id;
/* 135 */     return this;
  }

  public Domain() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-consumer-3.0.0.jar!/com/dianping/cat/consumer/storage/model/entity/Domain.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */